package com.champ.thread.suspend;

public class ObjectSynchro {
synchronized public void printString() {
	System.out.println("Object begin");
	if (Thread.currentThread().getName().equals("a")) {
		System.out.println("a 线程永远 suspend了");
		Thread.currentThread().suspend();
	}
	System.out.println("end");
}
}
class MyObject {
	private String name="1";
	private String password="qwet";
	public void setValue(String name,String password) {
		this.name = name;
		if (Thread.currentThread().getName().equals("a")) {
			System.out.println("暂停线程名称为a的线程");
			Thread.currentThread().suspend();
		}
		this.password = password;
	}
	public void printUserNameAndpassword() {
		System.out.println(this.name+ ":" + this.password);
	}
}